//
//  EzXml.hpp
//  ffmpeg_onvif
//
//  Created by 刘跃龙 on 8/8/18.
//  Copyright © 2018 absolutemobile. All rights reserved.
//

#ifndef EzXml_hpp
#define EzXml_hpp

#include <string>
#include "EzTools.h"
#include "tinyxml.h"

EZ_BEGIN

class EzXml
{
public:
    static void testXml(std::string xml);
public:
    static TiXmlDocument* newPointer_ParseXmlString(std::string xml);
    static TiXmlElement* newPointer_getRootElementFormXmlString(std::string xml);
    static std::string getStreamXmlString(TiXmlDocument* doc);
    static std::string getFormatXmlString(TiXmlDocument* doc);
public:
    static void LinkEndChildWithClone(TiXmlNode* parent,TiXmlNode* child);
    static std::string getNodeText(TiXmlNode* node);
    static void setNodeText(TiXmlNode* node,std::string text);
    static std::string getValueWithoutXmlns(std::string value);
public:
    static void setElementAttribute(TiXmlElement* target,std::string key,std::string value);
public:
    static TiXmlElement* getChildElement(TiXmlNode* parent,std::string key0);
    static TiXmlElement* getChildElement(TiXmlNode* parent,std::string key0,std::string key1);
    static TiXmlElement* getChildElement(TiXmlNode* parent,std::string key0,std::string key1,std::string key2);
    static TiXmlElement* getChildElement(TiXmlNode* parent,std::string key0,std::string key1,std::string key2,std::string key3);
    static TiXmlElement* getChildElement(TiXmlNode* parent,std::string key0,std::string key1,std::string key2,std::string key3,std::string key4);
    static TiXmlElement* getChildElement(TiXmlNode* parent,std::string key0,std::string key1,std::string key2,std::string key3,std::string key4,std::string key5);
    static TiXmlElement* getChildElement(TiXmlNode* parent,std::string key0,std::string key1,std::string key2,std::string key3,std::string key4,std::string key5,std::string key6);
    static TiXmlElement* getChildElement(TiXmlNode* parent,std::string key0,std::string key1,std::string key2,std::string key3,std::string key4,std::string key5,std::string key6,std::string key7);


    
};

EZ_END

#endif /* EzXml_hpp */
